Recently looked at the framework for XMPP, as an example of text chat, the message that needs to be sent is:Kizhong from is the message from which user, to is sent to who, the user of XMPP is in the form of a mailbox. Body is the text of the message we send.Well, in this case, we will develop an XMPP-based iOS chat
I recently read about the XMPP framework. Taking text chat as an example, the message to be sent is:
[HTML] View
Plaincopy
Message Type = "Chat" From = Kang@server.com" To = Test@server.com" >
Body > Helloword Body >
Message>
In the base, from is the message sent from the user, to is the message sent to the user, XMPP users are in the form of mailbox. Body is
[IPhone advanced] XMPP-based IOS chat client (IOS client 1), iPhone exmpp
After introducing the server, we will focus on writing our own IOS client program.
Let's take a look at what we
After introducing the server, we will focus on writing our own IOS client program.
Let's take a look at what we have done
First download the xmppframework framework.
Click zip to download
Next, use xcode to create a project
Drag the following files into the new project
Add framework
And set
Now we have all set up. Run it and see if there is any error.
If there is no error, our xmppframework will be s
1. Build server-Installation sequence-(Mysql->openfire->spark)Database: MySQLServer Management tools: OpenFireTest tool: SparkMySQL installation http://www.cnblogs.com/xiaodao/archive/2013/04/04/2999426.htmlNote: At the end of the terminal to execute the MySQL command, the last to be sealed number (;)OpenFire installation http://www.cnblogs.com/xiaodao/archive/2013/04/05/3000554.htmlBackground Management interface: http://localhost:9090/index.jspLogin name and password default is Admin adminServ
First we make an iOS client program ourselvesLet's look at what we've done.First download the Xmppframework frameworkClick Zip to downloadNext, create a new project with XcodeDrag the following files into the new projectJoin the frameworkHere we are all set up, run for a try, see if there is a mistakeIf there is no mistake, our xmppframework will join in the success.We set up our pages such as:Our KKViewCon
Add friends to the XMPP iOS client (3)Here we record the process of adding friends. Although there are examples on the Internet, they are not very comprehensive, and one of them is not given.
Initialize the XMPPRoster class. I have been searching for the initialization settings of this class for a long time. Not much. Paste the code below.
Initialize the XMPPRos
default admin account and customize it, you need to do the following(1) in the terminal, login to the specific database (OpenFire)Mysql-u root-p OpenFireThen enter the root password of the database(2) Delete the admin account in the table "Ofuser"Delete from Ofuser where username= ' admin ';(3) Create a custom administrator (user name: Xiaodao, Password: 123)INSERT into Ofuser (username, Plainpassword, Encryptedpassword, name, email, creationdate, modificationdate) VALUES (' Xia Odao ', ' 123 '
XMPP client development (1), xmpp client development
Smack can be used for XMPP client development. After downloading Smack and importing relevant jar files, you can start XMPP
Then the previous article continued to study and summarize.XMPP ClientOne design standard for XMPP systems is the need to support simple clients. In fact, the XMPP system architecture has only a few limitations on clients. The features that an XMPP client must support are:
Communicates with the
XMPP-IOS instant messaging development environment, xmpp-ios instant messaging1. Install MySQL
Sudo vi ~ /. Bash_profile
Enter I to enter the editing mode, and enter:
# mysqlalias mysql='/usr/local/mysql/bin/mysql'alias mysqladmin='/usr/local/mysql/bin/mysqladmin'# lsalias ls='ls -G'
Press ESC to exit the editing mode.
Ios xmpp-based development-XMPPFramewok framework (1): Basic knowledge, xmpp-xmppframewok
Recently, the open source tt of the mogujie.com team made me interested in im. Then I found XMPPFramework on the Internet for study,
I have written the following series of tutorials for your reference. Please forgive me for your correction.
Directory Index
I recently read about the XMPP framework. Taking text chat as an example, the message to be sent is:
[HTML]View
Plaincopy
In the base, from is the message sent from the user, to is the message sent to the user, XMPP users are in the form of mailbox. Body is the message text we send.
Now, let's develop an iOS chat c
(@"Authenticate Error:%@", [[Error UserInfo] description]); }}OnlineImplementation -(void) Xmppstreamdidauthenticate: (xmppstream *) Sender Delegate methodAfter successful authentication, callback the methodThis method was called after authentication have successfully finished.If authentication fails for some reason, the xmppStream:didNotAuthenticate:method would be called instead.Create a new Xmpppresence object, type available, send!-(void) Xmppstreamdidauthenticate: (Xmppstream *) Sender {
[IOS XMPP] logon to iOS XMPP
1. We recommend setting up an instant chat server. You can use Baidu to set up the server. There are many detailed tutorials.
Openfire is easy to use and written in Java,
Ejabberd is a well-known open-source Erlang project written in Erlang,
2. start logging on
1. Create an XMPPStream obje
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.